package com.summer.rx;

public class TestDome {

	public static void main(String[] args) throws InterruptedException {
		ThreadControl control = new ThreadControl();
		control.registered(new Runnable() {
			@Override
			public void run() {
				String name = Thread.currentThread().getName();
				System.out.println("在"+name+"线程上做第一件事");
			}
		});
		
		control.registered(new Runnable() {
			@Override
			public void run() {
				String name = Thread.currentThread().getName();
				System.out.println("在"+name+"线程上做第二件事");
			}
		});
		control.registered(new Runnable() {
			@Override
			public void run() {
				String name = Thread.currentThread().getName();
				System.out.println("在"+name+"线程上做第三件事");
			}
		});
		
		control.doAction();
		control.doAction();
//		control.switchThread();
		control.doAction();
	}
	
}
